Skip to content

Replace custom deepEqual with dequal/lite#64

Merged
Pearce-Ropion merged 6 commits into
mainfrom
claude/nifty-archimedes-Jf8pc
May 22, 2026
Merged

Replace custom deepEqual with dequal/lite#64
Pearce-Ropion merged 6 commits into
mainfrom
claude/nifty-archimedes-Jf8pc

Conversation

@Pearce-Ropion
Copy link
Copy Markdown
Collaborator

Summary

  • Replace the hand-rolled deepEqual utility with dequal/lite. The library is tiny (~300B) and correctly handles cases the custom implementation didn't (e.g. Date, RegExp, NaN, array length mismatches).
  • Configure tsdown so dequal is external in the ESM and CJS outputs (consumers dedupe via their bundler) but bundled into the UMD build so the script-tag distribution stays self-contained.
  • Drop the now-obsolete deepEqual.ts and its test file.

Implementation notes

  • dequal is added to dependencies of @sigmacomputing/plugin, which makes tsdown externalize it by default in every format.
  • packages/plugin-sdk/tsdown.config.ts overrides this for the UMD format via format.umd.deps.alwaysBundle, forcing dequal and dequal/lite to be inlined into the UMD bundle.

Verification

  • yarn types passes.
  • yarn build produces:
    • dist/esm/index.jsimport { dequal } from "dequal/lite";
    • dist/cjs/index.cjsrequire("dequal/lite")
    • dist/umd/sigmacomputing-plugin.umd.js → dequal inlined (no require('dequal'))

Test plan

  • yarn install
  • yarn build — inspect dist/esm/index.js, dist/cjs/index.cjs, and dist/umd/sigmacomputing-plugin.umd.js to confirm externalization vs. inlining.
  • yarn test (browser tests via Playwright) — confirm useEditorPanelConfig still avoids re-configuring on equal inputs.
  • yarn types

Generated by Claude Code

claude and others added 5 commits May 22, 2026 00:54
Drop the hand-rolled deep equality utility in favor of dequal/lite,
which is well-tested and handles cases the custom one didn't (Date,
RegExp, NaN, Array.length mismatches, etc).

Externalize dequal in ESM/CJS so consumers dedupe the dependency, but
bundle it into the UMD output so the script-tag distribution stays
self-contained.
@Pearce-Ropion Pearce-Ropion marked this pull request as ready for review May 22, 2026 17:17
@Pearce-Ropion Pearce-Ropion requested a review from a team May 22, 2026 17:17
@Pearce-Ropion Pearce-Ropion merged commit e241212 into main May 22, 2026
9 checks passed
@Pearce-Ropion Pearce-Ropion deleted the claude/nifty-archimedes-Jf8pc branch May 22, 2026 20:22
@Pearce-Ropion Pearce-Ropion mentioned this pull request May 23, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants